from django.shortcuts import render
from .models import Book
# Create your views here.
from django.http import HttpResponse

def index(request):
    # book = Book(name='毒鸡汤',author='父母们',price='13.14')
    # book.save()

    # return HttpResponse('添加成功')

    # book = Book.objects.get(pk=1)
    # print(book)

    # book = Book.objects.filter(name='毒鸡汤').first()
    # print(book)
    # book = Book.objects.get(pk=1)
    # book.delete()

    # book = Book.objects.get(pk=2)
    # book.price = 666
    # book.save()
    books = Book.objects.all()
    for book in  books:
        print(book)

    return HttpResponse('成功')


